package five;

public class 五十七组合模式 {
    public static void main(String[] args) {
        Computer computer = new Computer();
        computer.cpu = new Cpu();
        computer.mainBoard = new MainBoard();
        computer.memory = new Memory();
        computer.work();
    }
}

class Cpu {
    public void run() {
        System.out.println("quickly.........");
    }
}
class MainBoard {
    public void connect() {
        System.out.println("connect...........");
    }
}
class Memory {
    public void store() {
        System.out.println("store........");
    }
}
class Computer {
    Cpu cpu;
    Memory memory;
    MainBoard mainBoard;

    public void work() {
        cpu.run();
        memory.store();
        mainBoard.connect();
    }
}
